<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta content="B2B电商平台" name="description" />
<meta content="B2B电商平台" name="keyword" />

<title>B2B电商平台.店铺商品审核</title>
<link rel="icon" href="include/images/icss.ico" type="image/x-icon" />
<link rel="shortcut icon" href="include/images/icss.ico"
	type="image/x-icon" />
<link rel="stylesheet" type="text/css"
	href="<%=path %>/include/css/global.css" />
<link rel="stylesheet" type="text/css"
	href="<%=path %>/include/css/style.css" />
<link rel="stylesheet" type="text/css"
	href="<%=path %>/include/css/pro.css" />
<link rel="stylesheet" type="text/css"
	href="<%=path %>/include/css/proManage.css" />
<link rel="stylesheet" type="text/css"
	href="<%=path %>/include/css/mmt_trading.css" />

<link rel="stylesheet"
	href="<%=path %>/include/JQuery ui/css/smoothness/jquery-ui-1.7.3.custom.css"
	type="text/css"></link>
<link rel="stylesheet" type="text/css"
	href="<%=path%>/include/pagination/page.css" media="all">
<script type="text/javascript"
	src="<%=path %>/include/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path %>/include/js/cookies.js"></script>
<script type="text/javascript" src="<%=path %>/include/js/icss.busin.js"></script>
<script type="text/javascript"
	src="<%=path %>/include/JQuery ui/js/jquery-ui-1.7.3.custom.min.js"></script>
<script type="text/javascript"
	src="<%=path %>/include/js/icss.common.js"></script>
<script type="text/javascript"
	src="<%=path%>/include/pagination/jquery.pagination.js"></script>
<script type="text/javascript"
	src="<%=path%>/include/pagination/init.js"></script>
<script type="text/javascript" src="<%=path%>/include/layer/layer.js"></script>	
<link href="<%=path %>/include/DatePicker/skin/WdatePicker.css" rel="stylesheet" type="text/css">
<script src="<%=path %>/include/DatePicker/WdatePicker.js" charset="UTF-8" type="text/javascript"></script>
<script type="text/javascript" src="<%=path%>/include/layer/layer.js"></script>
<style type="text/css">
.price a.price_rise {
	background-position: -62px -126px;
}

.price a.price_drop {
	background-position: -62px -86px;
}

.price a.price_null {
	background-position: -1px -280px;
	padding-right: 0px;
}

.expire a.expire_drops {
	background-position: -61px -93px;
}

.expire a.expire_rise {
	background-position: -61px -134px;
}

.expire a.expire_null {
	background-position: -61px -15px;
	padding-right: 0px;
}

thead th {
	border: 1px solid #ddd;
	font-weight: bold;
}

#auditGoodsList a {
	text-decoration: none;
}

#auditGoodsList td {
	padding: 4px 4px;
	border: 1px solid #ddd;
}
#lie th{
    border: 1px solid #ddd;

}
.search_lis_se input{
    height:24px;
}
.save{
    width:44px;
    height:24px;
    line-height:24px;   
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: 0 -203px;
    border:0;
    cursor:pointer;
    font: 12px/1.5 arial,tahoma,\5b8b\4f53;
    margin: 0 0 0 5px;
    outline:none;
    background-image: url('<%=path%>/include/css/img/xs_bgx.png');   
}
</style>

<script type="text/javascript">
	$(document).ready(function() {
		_queryList();
	});
	//进入商品详细页面
	 function toView(id){
    	window.location.href ="<%=path%>/productPublish/updateProInfo.do?productId="+id;
    }
	
    var pagination;
    //查询审核列表
	function _queryList(){
		var proName = $("#proName").val();
		var begTime = $("#begTime").val();
	    var endTime = $("#endTime").val();
	    if(begTime>endTime){
		    if(endTime !=null&&endTime !=""&&endTime !="undefined"){
		    	parent.swal("开始时间不可以大于结束时间!");
		    	return;
		    }
		}  
		var url = "<%=path %>/productPublish/queryUnfinishedProList.do?proName="+proName+"&begTime="+begTime+"&endTime="+endTime;
  		pagination = _initPagination({'pageId':'pagination', 'cKey':'','url': url, 'rows': 5, 'callback':_initDataList});
  		
	}
	function _initDataList(data) {
	 		var d = data.rows;
	 		var total = data.total;
			var str = "";
			$("#auditGoodsList").empty();
			for(var i=0;i<d.length;i++){
				str += "<tr>";
				str += "    <td class='t1' style='text-align:center;vertical-align: middle'>"+d[i].PID+"</td>";
				str += "    <td class='t2' style='text-align:center;vertical-align: middle'>";
				str += "    		<a href='javascript:toView(\""+d[i].PRODUCT_ID+"\")' target='_blank'>";
				if(d[i].PRODUCT_PIC==''){
					str += "        		<img src='<%=path%>/download/error/nopicture.jpg' width='40' height='40' alt='' resizeimg='true' onmousedown='' onerror='javascript:this.src=\"<%=path%>/download/error/nopicture.jpg\";' style='width: 50px; height: 43.5px;'>";
				} else {
					str += "        		<img src='"+d[i].PRODUCT_PIC+"' width='40' height='40' alt='' resizeimg='true' onmousedown='' onerror='javascript:this.src=\"<%=path%>/download/error/nopicture.jpg\";' style='width: 50px; height: 43.5px;'>";
				}
				str += "    		</a>";
				str += "	</td>";
				str += " 	<td class='t3' style='text-align:left;vertical-align: middle'>";
				str += "			<a href='javascript:toView(\""+d[i].PRODUCT_ID+"\")' target='_blank'>"+d[i].PRODUCT_NAME+"</a>";
				str +=" 	</td>";
				str +="		<td class='t4' id='pubdateTd'  style='text-align:center;vertical-align: middle'>"+d[i].CREATE_TIME;
				str +=" 	</td>";
				str +="		<td class='t3' id='pubdateTd'  style='text-align:center;vertical-align: middle'>";
				str +="			<a href='javascript:toView(\""+ d[i].PRODUCT_ID +"\")' >编辑</a> | <a href='javascript:_delInfo(\""+ d[i].PRODUCT_ID +"\",\""+ d[i].PRODUCT_NAME +"\")' >删除</a>";
				str +="		</td>";
				str +=" </tr>";
			}
			$("#auditGoodsList").append(str);
			setTimeout(function(){_reHeight("rightFrame","contentDiv");},1000);
			
	 }

	function _delInfo(id,content){
		var ctt = "删除商品"+content+"吗？"
		parent.layer.confirm(ctt, function(index){
			$.ajax({
				type:"post",
				url:"<%=path%>/productPublish/delInfo.do",
				dataType:"text",
				data:{productId:id},
				success:function(data){
					if(data){
						var flag = data;
						if(data=="t"){
							parent.layer.alert("删除成功");
							_queryList();
						}else{
							parent.layer.alert("删除失败");
						}
					}
				}
			});
			parent.layer.close(index);
		});
	}
</script>
</head>
<body>
	<div id="contentDiv" style="padding:4px; width:99%;font-family: '微软雅黑';">
		<input type="hidden" id="refundType" name="refundType"/>
		<input type="hidden" id="rejectReason" name="rejectReason"/>
		<div class="colnums-2-ab-b" style="overflow-x:auto;">
			<div class="toptil" >完善商品</div>
			<div class="search_lis" style="border: 1px solid #e0e0e0;background: #f5f5f5;padding-left:10px;margin-bottom:10px;width:98.5%;height: 30px;">
				<div class="search_lis_se" style="font-size: 14px;">
					<span>商品名称：</span> 
					<input name="proName" id="proName" type="text" class="in_bit" maxlength="40" value=""  placeholder="请输入商品名称"
					 style="color:#000000;width: 120px;">
					 <span style="margin-left:10px;">创建时间： </span>
					<input type="text" id="begTime" name="begTime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,maxDate:'#F{$dp.$D(\'endTime\')}'})" style="width: 110px;height: 24px; padding-left: 3px" onfocus="WdatePicker({position:{left:314,top:88}})" class="Wdate" value="" realvalue="">
					<span style="margin: 0px 5px;">至</span>
					<input type="text" id="endTime" name="endTime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,minDate:'#F{$dp.$D(\'begTime\')}'})" style="width: 110px;height: 24px; padding-left: 3px;margin-right: 2px;" onfocus="WdatePicker({position:{left:463,top:88}})" class="Wdate" value="" realvalue="">
					<button type="button" class="save" onclick="_queryList()">查询</button>
				</div>
				<div class="wantBuy" id="caigouInfo"></div>
			</div>
			<div class="listed_tb_k" style="width:99.65%; border: none;">
				<table cellspacing="0" cellpadding="0">
					<thead>
						<tr id="lie">
							<th class="t1" style="text-align:center;vertical-align: middle">序号</th>
							<th class="t2" style="text-align:center;vertical-align: middle">图片</th>
							<th class="t3" style="text-align:center;vertical-align: middle">商品名称</th>
							<th class="t4" style="text-align:center;vertical-align: middle">创建日期</th>
							<th class="t3" style="text-align:center;vertical-align: middle">操作</th>
						</tr>
					</thead>
					<tbody id="auditGoodsList">
					</tbody>
				</table>
				<div id="pagination"></div>
			</div>
		</div>
		<div class="clear"></div>
	</div>
</body>
<script type="text/javascript">
	$(document).ready(function() {
		_reHeight("rightFrame", "contentDiv");
	});
</script>
</html>
